﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link href="${pageContext.request.contextPath}/css/admin/common.css" type="text/css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/list.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/css/layout.css" rel="stylesheet" type="text/css"/>
    <base href="<%=basePath+"/"%>">
    <title>管理员列表</title>

    <style type="text/css">
        table {
            text-align: center;
            border-collapse: collapse;
        }

        .bgcolor {
            background-color: #F08080;
        }
    </style>
    <script type="text/javascript">
        function changeColor(obj) {
            obj.className = "bgcolor";
        }

        function changeColor1(obj) {
            obj.className = "";
        }
    </script>
</head>
<body>

<div class="tools">
    <ul class="toolbar">
        <li><cite></cite><a href="backend/article/create" target="center"><span>
            <img src="images/t01.png"/></span>添加</a><i></i></li>
        <!--   <li ></li>
        <li ></li>  -->
        <%--        <li><a href="adminGoods/selectGoods?act=updateSelect" target="center"><span><img src="images/t02.png"/></span>修改</a>--%>
        <%--        </li>--%>
        <!-- <li class="click"><span><img src="images/t03.png" /></span>删除</li>-->
        <%--        <li><a href="adminGoods/selectGoods?act=deleteSelect" target="center"><span><img src="images/t03.png"/></span>删除</a>--%>
        <%--        </li>--%>
        <%--        <li><a href="jqueryChart.html"><span><img src="images/t04.png"/></span>统计</a></li>--%>
        <%--        <li><span><img src="images/t05.png"/></span>设置</li>--%>
    </ul>
    <iframe src="adminGoods/toShopSearch" scrolling="no" frameborder="0" width="400" height="42"></iframe>
</div>


<c:if test="${page.getTotal() == 0 }">
    没有文章。
</c:if>
<c:if test="${page.getTotal() != 0 }">
    <table border="1" bordercolor="PaleGreen">
        <thead>
        <th width="20px">ID</th>
        <th width="200px">code</th>
        <th width="200px">缩略图</th>
        <th width="200px">标题</th>
        <th width="50px">简介</th>
            <%--        <th width="50px">类型</th>--%>
        <th width="50px">排序</th>
        <th width="200px">创建时间</th>
        <th width="200px">修改时间</th>
        <th width="200px">操作</th>
        </thead>
        <c:forEach items="${page.getRecords()}" var="article">
            <%--@elvariable id="article" type="com.blog.entity.Article"--%>
            <tr onmousemove="changeColor(this)" onmouseout="changeColor1(this)">
                <td>${article.id }</td>
                <td>${article.code}</td>
                <td>
                    <img src="<%=basePath%>${article.img}" width="180px">
                </td>
                <td>${article.title}</td>
                <td>${article.description}</td>
                <td>${article.order}</td>
                <td>${article.createdTime}</td>
                <td>${article.updatedTime}</td>
                <td><a href="backend/article/view?id=${article.id}" target="center">详情</a>
                    <a href="backend/article/update?id=${article.id}" target="center">修改</a>
                    <a href="backend/article/delete?id=${article.id}" target="center">删除</a>
                </td>

            </tr>
        </c:forEach>
        <tr border="1">
            <td colspan="10" align="right">
                &nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;共${page.getTotal()}条记录&nbsp;&nbsp;共${page.getPages()}页&nbsp;&nbsp;
                第${page.getCurrent()}页&nbsp;&nbsp;
                <c:url var="url_pre" value="/backend/product/index">
                    <c:param name="curPage" value="${page.getCurrent() - 1 }"/>
                </c:url>
                <c:url var="url_next" value="/backend/product/index">
                    <c:param name="curPage" value="${page.getCurrent() + 1 }"/>
                </c:url>
                <!-- 第一页没有上一页 -->
                <c:if test="${page.getCurrent() != 1 }">
                    <a href="${url_pre}">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
                </c:if>
                <!-- 最后一页，没有下一页 -->
                <c:if test="${page.getCurrent() != page.getPages() && page.getPages() != 0}">
                    <a href="${url_next}">下一页</a>
                </c:if>
            </td>
        </tr>
    </table>
</c:if>
</body>
</html>